package com.meta.menu.bo;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;


@Data
public class Menu {
    String code;
    String name;
    String description;
    String moduleCode;
    String mdCode;
    String mvCode;
    boolean leaf = false;
    List<Menu> children = new ArrayList<>();
    public Menu(){
    }
    public Menu(String code, String name, String description){
        this.code = code;
        this.name = name;
        this.description = description;
    }
    public void setMd(String moduleCode,String mdCode, String mvCode){
        this.mdCode = mdCode;
        this.mvCode = mvCode;
        this.leaf = true;
        this.moduleCode = moduleCode;
    }
    public void setMd(String moduleCode,String mdCode, String mvCode, boolean leaf){
        this.mdCode = mdCode;
        this.mvCode = mvCode;
        this.leaf = leaf;
        this.moduleCode = moduleCode;
    }
    public void addChild(Menu child){
        this.children.add(child);
    }
}
